package com.jiashihui.schema_lgorithm.schema.facade;

/**
 * @author jiashihui
 * @describe: 电脑
 * @date 2019/03/15
 */
public class Computer {

    /* 电脑CPU */
    private CPU cpu;

    /* 电脑内存 */
    private Memory memory;

    /* 电脑硬盘 */
    private Disk disk;

    public Computer() {
        cpu = new CPU();
        memory = new Memory();
        disk = new Disk();
    }

    /* 启动 */
    public void startup() {
        System.out.println("startup computer");
        cpu.startup();
        memory.startup();
        disk.startup();
        System.out.println("startup computer finished");
    }

    /* 关闭 */
    public void shutdown() {
        System.out.println("shutdown computer");
        cpu.shutdown();
        memory.shutdown();
        disk.shutdown();
        System.out.println("shutdown computer finished");
    }

}
